import excel
import crab
import mysql
if __name__ == '__main__':
    str_array = excel.get_col_to_array("excel/Food_list.xlsx", 0, 1, 2)
    print(str_array)
    urls = crab.minit_search_by_word(str_array)
    data = []
    print(len(urls))
    for i in range(len(urls)):
        d = crab.minit_get_data(urls[i], str_array[i])
        if d is None:
            mysql.insert_into_db(['未查到', str_array[i], '0', '0', '0', '0', 'none'])
        else:
            mysql.insert_into_db(d)
        # data.append(crab.minit_get_data(urls[i], str_array[i]))
